<?php

include_once "../include/fun.ip.php";


/******************log*******************************/
/*****   ****/
$pid =  intval( $_GET['pid']);
$id = intval($_GET['id']);
$orderid = intval($_GET['orderid']);
$url = $_GET['url'];
if($pid && $pushid && $url){
exit;
}
$adpid = $pid; //广告位id
$pushid = $id; //广告位投放id
if(!$ip){
	$ip = getip();
}
$timestamp = time();
$endtime3 = mktime(0,0,0,date('m')+6,date('d'),date('Y'));
if(!isset($_COOKIE['_Xdwuv'])){
	$tmpname = uniqid();
	setcookie('_Xdwuv',$tmpname,$endtime3,'/','.xcar.com.cn');
	$uv = $tmpname;
}else{
	$uv = $_COOKIE['_Xdwuv'];
}
 

/******************log*******************************/
if($pid && $pushid && $url){

//****************重定向*********************************/

	//$url = $_GET['url'];
	//if(!(stripos($url,'http')!==false)){
		  //$url = 'http:\/\/'.$url ;
	//}
	//Header("Location:$url");



$reurl= "<SCRIPT LANGUAGE='javascript'>";

$reurl= "var _Ximgurl='http://dwp.xcar.com.cn/1.gif';
		if( document.location.protocol!='file:' ){
		 
			var _Xstr=_Ximgurl+'?'+'".$uv."'+'&'+'".$pushid."'+'&'+'".$adpid."'+'&'+'".$orderid."'+'&'+'".$ip."'+'&'+'".$timestamp."';
			var _Xpimgobj = new Image();
			_Xpimgobj.src = _Xstr;
		}
		";

$reurl.=	"var url =	decodeURIComponent('".$url."');";
$reurl.= "location.href=url ;";
$reurl.="</SCRIPT>";
echo $reurl;
}
//http://ad.xcar.com.cn/a14/adpush/push/adclick.php?pid=3&id=172&orderid=3119&url=http://www.xcar.com.cn






















?>